<template>
	<div class="view">
		<textarea class="textarea" v-model.trim="info" placeholder="请输入您宝贵的建议!"></textarea>
		<button @click="send()" type="primary">发送</button>
	</div>
</template>
<script>
// import { addfeedback } from "@/apis/request";
import { addfeedback } from '../../../apis/request.js';
export default {
	data() {
		return {
			info: ''
		};
	},
	methods: {
		send() {
			if (this.info == '') {
				this.$Toast('请填写内容');
			} else {
				addfeedback({
					feedbackDetails: this.info
				}).then(res => {
					if (res.code == 200) {
						this.$dialog('提示', '添加成功').then(() => {
							wx.navigateBack({
								delta: 1
							});
						});
					} else {
						this.$dialog('提示', res.message);
					}
				});
			}
		}
	}
};
</script>
<style lang="scss" scoped>
.view {
	min-height: 100vh;
	background-color: #f1efef;

	.textarea {
		width: 750rpx;
		padding: 30rpx;
		border: none;
		height: 400rpx;
		background-color: #fff;
	}
	button {
		margin: 50rpx auto 0 auto;
		border-radius: 60rpx;
		width: 670rpx;
	}
}
</style>
